﻿Public Class frmUsuarioCambiarEstado

    Private mEstadoBS As Banco.BS.Usuarios
    Private mEstadoBE As Banco.BE.Usuarios

    Private mId As Integer
    Private mNombre As String
    Private mPerfil As String
    Private mEstado As String

    'Propiedades
    Property Id As Integer
        Get
            Return mId
        End Get
        Set(ByVal value As Integer)
            mId = value
        End Set
    End Property

    Property Nombre As String
        Get
            Return mNombre
        End Get
        Set(ByVal value As String)
            mNombre = value
        End Set
    End Property

    Property Perfil As String
        Get
            Return mPerfil
        End Get
        Set(ByVal value As String)
            mPerfil = value
        End Set
    End Property

    Property Estado As String
        Get
            Return mEstado
        End Get
        Set(ByVal value As String)
            mEstado = value
        End Set
    End Property
   
    Private Sub frmUsuarioCambiarEstado_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'Cargamos los datos al formulario
        Me.txtNombreCompleto.Text = Nombre
        Me.cbPerfil.SelectedIndex = Perfil
        Me.cbEstado.SelectedIndex = Estado

    End Sub

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click

        mEstadoBS = New Banco.BS.Usuarios
        mEstadoBE = New Banco.BE.Usuarios

        mEstadoBE.Id = Id
        mEstadoBE.Estado = cbEstado.SelectedIndex
        If (Not mEstadoBS.CambiaEstado(mEstadoBE)) Then
            MessageBox.Show("Problemas al Editar")
        Else
            Me.DialogResult = Windows.Forms.DialogResult.OK
        End If

    End Sub

End Class
